var assert = require('assert');
const MarioChar1 = require('../test/shema');



describe ('find rec test',function(){
    var char1;
    beforeEach(function(done){
      char1 = new MarioChar1({
        name:'Mario',
        speed:'20',

      });
      char1.save().then(function(){
        console.log('++++++++');
        console.log(char1);
        console.log('--------')

         assert(char1.isNew === false);
         done();

      });

    });



    it('find one rec ',function(done){
      MarioChar1.findOne({name:'Mario'}).then(function(result){
        assert(result.name === 'Mario');
        done();

      })

    });

    it('find one rec by id  ',function(done){
      MarioChar1.findOne({_id:char1._id}).then(function(result){
        assert(result._id.toString() === char1._id.toString());
        done();

      })

    });



});
